The present invention relates to a method for calculating duration of connections, especially in connection with packet switched network, to determine a charge for such connections based on time and volume. Although the present invention is described in connection with measuring duration of connections for charging purposes according to volume and time in packet switched networks, the present invention finds other applications where duration of connections is measured.
When a charge for a connection in a packet switched network is based on time and volume, it is necessary to calculate the total volume of transmitted-data and the duration of the connection. The formula for charge based on volume and time may be written as follows:
Charge=xcex1*Volume+xcex2*Time+xcex3
wherein xcex1 and xcex2 are weight factors for respectively volume and time, and wherein xcex3 is the fixed cost for establishing a connection.
The equipment for measuring the time and volume will be located between the source and the destination of the connection in question, the location being in a router, switch or a stand-alone unit. The metering equipment should not effect the data sent on this connection, and it should only do measurements. The process of effecting measurements will involve some delay in the traffic. This delay should be as small as possible, possibly not effecting the total performance to any significant degree. In order to calculate the total charge, a charging manager may retrieve data from the measuring or metering equipment. Such a charging manager is shown connected to metering equipment for example in FIG. 1.
FIG. 1 shows the metering equipment placed between the source and the destination. The calculated volume and time are collected by the charging manager, and the total charge is calculated. The fixed cost xcex3 for establishing a connection is added to the charge at the beginning of the connection.
Depending on the type of network, different methods may be used to obtain the total volume. If the size of each packet is fixed, e.g., in an ATM network, only the number of packets needs to be counted. This counter can then be multiplied by the fixed packet length to obtain the total volume. If the size of packets is variable, e.g., in an IP network, it will be necessary to compute the total length of each packet on the connection in order to obtain the total volume.
One way of calculating connection duration if the network uses a connection-oriented protocol is by recognizing the setup and disconnect messages. The time counter would be started when the setup message is sent, and stopped when a disconnect message is sent. Recognizing the setup and disconnect messages is not possible in a connection-less network because no such messages exist. So a second way of calculating connection duration in a connection-less network is to start the timer when the metering equipment notices the first packet on the connection. A policy has to be used for stopping the timer, i.e., the timer is stopped after a fixed amount of time.
There are two problems with the first approach outlined above. First, to recognize the setup and disconnect messages, some part of the protocol must be implemented in the metering equipment. This introduces more delay in the metering equipment. Alternatively, the metering equipment itself has to take an active role in the establishment of the connection. The metering equipment can remove the setup message from the network, and on behalf of the originator, send a new setup message.
A second problem is that the counter is only stopped when the disconnect message is received. This problem with measuring the duration of connections in connection-oriented networks by relying on the setup and disconnect messages occurring if the disconnect packet is lost or corrupted is illustrated in FIG. 2. If one of the stations terminates for some reason, it is not certain that a disconnect signal will ever be sent. To avoid having the time counter count on indefinitely, a policy for determining when a connection is considered broken has to be implemented.
The problem with the second approved is that if one reads the timer after the last packet, but before time-out, this gives an incorrect value for the length of the call, a condition illustrated schematically in FIG. 3. More specifically, FIG. 3 illustrates the problem in connection-less networks of determining the last packet. If the duration timer is read before the predefined time-out, an incorrect value for the actual duration will be provided.
An object of the present invention is to provide a method for easier and more accurate calculation of the duration of connections.
Another object of the present invention is to implement a time counter for a connection in metering equipment.
A further object of the present invention is to provide a method solving problems with measuring duration of connections in both connection-oriented and connection-less networks.
A further object of the present invention is to provide a method for calculating duration of connections independent of the protocol used for the measured connections.
Another object of the present invention is to provide a method for calculating duration of connections wherein no decision on time-outs has to be made.
The above and other objects are achieved in the present timer counter invention using a first timer counter measuring the time between successive arriving packets and a second timer updated by the value of the first timer counter when a new packet arrives. The timer counter presents the time between the first and last arrived packet and is updated only if a new packet arrives. Consequently, the timer counter provides the exact value for the duration of the connection after the connection is finished as well as before and during the time the connection is active. Because the timer counter does not rely on understanding the protocol used for the connection, it can work for both connection-oriented as well as for connection-less networks.
Further features and advantages of the present invention will appear from the following description taken in connection with the appending drawings, as well as from the attached patent claims.